package com.chagee.store.operation.common.exception;

import com.chagee.base.constant.CommonErrorCode;
import com.chagee.base.exception.BaseException;
import com.chagee.base.exception.BizExpCode;
import com.chagee.store.operation.api.response.BaiduAiDetectResponse;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * @author Lee
 * @version 1.0
 * @className ParamBizException
 * @description 异常
 * @date 2023/12/19 17:01:45
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class ParamBizException extends BaseException {

	private List<BaiduAiDetectResponse> data;

	private ParamBizException() {
		super();
	}

	/**
	 * 自定义异常-默认异常码
	 *
	 * @param errorMsg
	 */
	public ParamBizException(String errorMsg) {
		super(CommonErrorCode.FAIL.getErrorCode(), errorMsg);
	}

	public ParamBizException(String errorMsg, Throwable t) {
		super(CommonErrorCode.FAIL.getErrorCode(), errorMsg, t);
	}

	/**
	 * 自定义异常
	 *
	 * @param errorCode
	 * @param errorMsg
	 */
	public ParamBizException(String errorCode, String errorMsg) {
		super(errorCode, errorMsg);
	}

	/**
	 * 自定义异常
	 *
	 * @param errorMsg
	 */
	public ParamBizException(BizExpCode bizExpCode, String errorMsg) {
		super(bizExpCode.getErrorCode(), errorMsg);
	}

	public ParamBizException(String errorCode, String errorMsg, Throwable t) {
		super(errorCode, errorMsg, t);
	}

	/**
	 * 自定义异常Enum
	 *
	 * @param bizExpCode
	 */
	public ParamBizException(BizExpCode bizExpCode, List<BaiduAiDetectResponse> data) {
		super(bizExpCode.getErrorCode(), bizExpCode.getErrorMsg());
		this.data = data;
	}

	/**
	 * 自定义异常Enum
	 *
	 * @param bizExpCode
	 * @param t          异常堆栈
	 */
	public ParamBizException(BizExpCode bizExpCode, Throwable t) {
		super(bizExpCode.getErrorCode(), bizExpCode.getErrorMsg(), t);
	}

	@Override
	public String toString() {
		return super.toString();
	}
}
